#include "facade.h"

LibraryFacade::LibraryFacade()
{
    m_borrowSubSys = std::make_unique<BorrowSubSystem>();
    m_querySubSys = std::make_unique<QuerySubsystem>();
    m_returnSubSys = std::make_unique<ReturnSubSystem>();
}

void LibraryFacade::BorrowBooks(std::string name)
{
    if(m_querySubSys->queryBooks(name)){
        m_borrowSubSys->borrowBooks(name);
    }
    else{
        std::cout << "sorry,no this book." << std::endl;
    }
}

void LibraryFacade::ReturnBooks(std::string name)
{
    m_returnSubSys->returnBooks(name);
}
